﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace CuteConsoleApplication
{
  public class Program : CuteProgramBase
  {
    public void Main()
    {
      int a = Request<int>("Введите a:");
      int b = Request<int>("Введите b:");

      int n = a * b;
      while (n <= a * b)
      {
        if (a%n == 0)
        {
          if (b%n == 0)
          {
            WriteLine("НОД " + a + " и " + b + " равен " + n);
            return;
          }
        }
        n = n - 1;
      }
    }
  }
}
